package com.hl.service.impl;

import com.hl.domain.ConsultWait;
import com.hl.mapper.ConsultWaitMapper;
import com.hl.service.ConsultWaitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultWaitServiceImpl implements ConsultWaitService {
    @Autowired
    private ConsultWaitMapper consultWaitMapper;
//    新增

    @Override
    public int add(ConsultWait consultWait) {
        return consultWaitMapper.insert(consultWait);
    }

//    根据id删除
    @Override
    public int remove(Integer id) {
        return consultWaitMapper.deleteById(id);
    }

//    批量删除
    @Override
    public int removeBatch(Integer[] ids) {

        return consultWaitMapper.deleteBatch(ids);
    }

//    根据id查询
    @Override
    public ConsultWait findById(Integer id) {
        return consultWaitMapper.selectById(id);
    }

    //    查询全部
    @Override
    public List<ConsultWait> findAll() {
        List<ConsultWait> list = consultWaitMapper.selectAll();

        return list;
    }

//    模糊查询
    @Override
    public List<ConsultWait> findLike(String username, String name) {
        return consultWaitMapper.selectLike(username,name);
    }
}
